<div ng-controller="Umbraco.Editors.Content.CopyController">
    <div class="umb-dialog-body form-horizontal">
        <div class="umb-pane">
            
            <ng-form name="copyForm">
                <p class="abstract" ng-hide="success">
                    Choose where to copy <strong>{{currentNode.name}}</strong> to in the tree structure below
                </p>

                <div class="alert alert-error" ng-show="error">
                    <h4>{{error.errorMsg}}</h4>
                    <p>{{error.data.Message}}</p>
                </div>

                <div class="alert alert-success" ng-show="success">
                    <p>
                        <strong>{{currentNode.name}}</strong> was copied to
                        <strong>{{target.name}}</strong>
                    </p>

                    <button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
                </div>

                <div ng-hide="success">
                    <umb-tree section="content"
                              hideheader="false"
                              hideoptions="true"
                              isdialog="true"
                              eventhandler="dialogTreeEventHandler">
                    </umb-tree>


                    <umb-pane>
                        <umb-control-group label="Relate to original">
                            <input type="checkbox" ng-model="$parent.$parent.relateToOriginal" />
                        </umb-control-group>
                    </umb-pane>

                </div>
            </ng-form>
        </div>
    </div>

    <div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
        <a class="btn btn-link" ng-click="nav.hideDialog()">
            <localize key="general_cancel">Cancel</localize>
        </a>
        <button class="btn btn-primary" ng-click="copy()">
            <localize key="actions_copy">Copy</localize>
        </button>
    </div>
</div>